import ExpenseReportDetailComp from "containers/expense-report/base-expense-report-detail";
import RequestDetailComp from "containers/request/base-request-detail";
import CheckCenterBillComp from "containers/financial-management/check-center/check-center-bill";
import SupplierBankAccountComp from "containers/financial-management/supplier-management/supplier-bank-account";
import SupplierCompanyDeliveryComp from "containers/financial-management/supplier-management/supplier-company-delivery";
import SupplierDetailComp from "containers/financial-management/supplier-management/supplier-detail";
import WaitForBillingListComp from "containers/financial-management/wait-for-billing/wait-for-billing-tab";
import InvoiceStatusQueryComp from "containers/financial-management/wait-for-billing/invoice-status-query";
import WaitForBillingJdComp from "containers/financial-management/wait-for-billing/wait-for-billing-jd";
import NewBillingRuleComp from "containers/financial-management/wait-for-billing/new-billing/new-billing-rule";
import EditBillingRuleComp from "containers/financial-management/wait-for-billing/new-billing/edit-billing-rule";
import SearchNewBillingComp from "containers/financial-management/wait-for-billing/new-billing/search-new-billing";
import SearchBillingDetailComp from "containers/financial-management/wait-for-billing/new-billing/search-billing-detail"
import BillingDetailComp from "containers/financial-management/wait-for-billing/new-billing/billing-detail";
import OverallSubListComp from "containers/financial-management/loan-and-refund/overall-sub-list";
import OverallRestaurantListComp from "containers/financial-management/loan-and-refund/overall-restaurant-list";

import ScanAuditComp from "containers/financial-management/finance-audit/scan-audit";
import ScanGunAuditComp from "containers/financial-management/finance-audit/scan-gun-audit";
import FinanceAuditComp from "containers/financial-management/finance-audit/finance-audit";

import LoanDetailComp from "containers/loan-billing/loan-detail";

import ConfirmManagementComp from "containers/financial-management/confirm-payment/confirm-payment-v2";
import PaymentBatchComp from "containers/financial-management/payment-batch";
import ExpenseViewComp from "containers/financial-management/expense-view/expense-view";
import FinanceViewComp from "containers/financial-management/finance-view/finance-view";
import CheckCostApplicationComp from "containers/financial-management/check-cost-application/check-cost-application"

import CheckCenterComp from "containers/financial-management/check-center/check-center";
import SupplierManagementComp from "containers/financial-management/supplier-management/supplier-management";
import BatchPrintInvoiceComp from "containers/financial-management/batch-print-view";
import WaitForBillingComp from "containers/financial-management/wait-for-billing/wait-for-billing";
import LoanAndRefundComp from "containers/financial-management/loan-and-refund/loan-and-refund";
import ThirdPartyComp from "containers/third-party/third-party";
import EntryInformationComp from "containers/financial-management/entry-infomation/entry-information";
import InvoiceBagApprove from "containers/financial-management/invoice-bag-approve/invoice-bag-approve"
import InvoiceBagApproveDetail from "containers/financial-management/invoice-bag-approve/invoice-bag-approve-detail/invoice-bag-approve-detail"
import SettlementCost from 'containers/financial-management/settlement-cost/settlement-cost';
import CreditManagementComp from "containers/credit-setting/credit-management/credit-management"
import InvoiceManagementPlatformComp from 'containers/financial-management/invoice-management-platform'
import MeiyaAccountPeriodComp from "containers/financial-management/meiya-account-period";
import DdAccountPeriodComp from "containers/financial-management/dd-account-period";

//财务管理
const financialManagement = {
  key:'financial-management',
  icon: 'pay-circle-o',
  subMenu: [
    //单据审核
    {
      key:'finance-audit',
      url:'/main/financial-management/finance-audit/:tab',
      components: FinanceAuditComp,
      parent: 'financial-management',
      children: {
        //报销单详情
        expenseReportDetailAudit: {
          key:'expense-report-detail-audit',
          url:'/main/financial-management/finance-audit/expense-report-detail-audit/:expenseReportOID/:backType/:tab',
          components: ExpenseReportDetailComp,
          parent: 'finance-audit'
        },
        //借款单详情
        loanRequestDetailAudit: {
          key:'loan-detail-audit',
          url:'/main/financial-management/finance-audit/loan-detail-audit/:formOID/:loanBillOID/:backType/:tab',
          components: LoanDetailComp,
          parent: 'finance-audit'
        },
        //扫码审核
        scanAudit: {
          key:'scan-audit',
          url:'/main/financial-management/finance-audit/:tab/scan-audit',
          components: ScanAuditComp,
          parent: 'finance-audit'
        },
        //扫码枪审核
        scanGunAudit: {
          key:'scan-gun-audit',
          url:'/main/financial-management/finance-audit/:tab/scan-gun-audit',
          components: ScanGunAuditComp,
          parent: 'finance-audit'
        }
      },
      pageRole:'EXPENSEAUDIT',
      fpItem: ["web.finance.review.disabled"],
      fpValue: [[false,undefined]]
    },
    //确认付款
    {
      key:'confirm-payment',
      url:'/main/financial-management/confirm-payment',
      components: ConfirmManagementComp,
      parent: 'financial-management',
      children: {
        //报销单详情
        expenseReportDetailPayment: {
          key:'expense-report-detail-payment',
          url:'/main/financial-management/confirm-payment/expense-report-detail-payment/:expenseReportOID/:backType',
          components: ExpenseReportDetailComp,
          parent: 'confirm-payment'
        },
        //借款单详情
        loanRequestDetailPayment: {
          key:"loan-detail-payment",
          url:'/main/financial-management/confirm-payment/loan-detail-payment/:formOID/:loanBillOID/:backType',
          components:LoanDetailComp,
          parent:'confirm-payment'
        }
      },
      pageRole:'EXPENSEPAYMENT',
      fpItem: ["web.financial.approval.sure.payment.disabled","all.payment.platform"],
      fpValue: [[false,undefined],[false,undefined]]
    },
    //付款批次
    {
      key:'payment-batch',
      url:'/main/financial-management/payment-batch',
      components: PaymentBatchComp,
      parent: 'financial-management',
      pageRole:'PAYMENTBATCH',
      fpItem: ["finance.batch.disabled","all.payment.platform"],
      fpValue: [[false,undefined],[false,undefined]]
    },
    //报销单查看
    {
      key:'finance-view-expense',
      url:'/main/financial-management/finance-view-expense',
      components: ExpenseViewComp,
      parent: 'financial-management',
      children: {
        //报销单详情
        expenseReportDetailView: {
          key:'expense-report-detail-view',
          url:'/main/financial-management/finance-view-expense/expense-report-detail-view/:expenseReportOID/:tab',
          components: ExpenseReportDetailComp,
          parent: 'finance-view-expense'
        }
      },
      pageRole:'EXPENSEVIEW',
      fpItem: ["finance.expenseView.disabled"],
      fpValue: [[false,undefined]]
    },
    //借款单查看
    {
      key:'finance-view-loan',
      url:'/main/financial-management/finance-view-loan',
      components: FinanceViewComp,
      parent: 'financial-management',
      children: {
        //借款单详情
        loanDetailView: {
          key:'loan-detail-view',
          url:'/main/financial-management/finance-view-loan/loan-detail-view/:formOID/:loanBillOID',
          components: LoanDetailComp,
          parent: 'finance-view-loan'
        }
      },
      pageRole:'EXPENSEVIEW',
      fpItem: ["finance.expenseView.disabled"],
      fpValue: [[false,undefined]]
    },
    //费用申请单查看
    {
      key:'check-cost-application',
      url:'/main/financial-management/check-cost-application',
      components: CheckCostApplicationComp,
      parent: 'financial-management',
      children: {
        //费用申请单详情
        expenseReportDetailView: {
          key:'cost-application-detail',
          url:'/main/financial-management/check-cost-application/cost-application-detail/:formOID/:applicationOID',
          components: RequestDetailComp,
          parent: 'check-cost-application'
        }
      },
      pageRole:'EXPENSEAPPLICATIONVIEW'
    },
    //对账中心
    {
      key: 'check-center',
      url: '/main/financial-management/check-center',
      components: CheckCenterComp,
      tenant: false,
      company: true,
      children:{
        //机票账单
        checkCenterPlane: {
          key: 'check-center-plane',
          url: '/main/financial-management/check-center/check-center-plane/:type',
          components: CheckCenterBillComp,
          parent: 'financial-management'
        },
        //酒店账单
        checkCenterHotel: {
          key: 'check-center-hotel',
          url: '/main/financial-management/check-center/check-center-hotel/:type',
          components: CheckCenterBillComp,
          parent: 'financial-management'
        },
        //火车账单
        checkCenterTrain: {
          key: 'check-center-train',
          url: '/main/financial-management/check-center/check-center-train/:type',
          components: CheckCenterBillComp,
          parent: 'financial-management'
        },
        //用车账单
        checkCenterCar: {
          key: 'check-center-car',
          url: '/main/financial-management/check-center/check-center-car/:type',
          components: CheckCenterBillComp,
          parent: 'financial-management'
        },
        //话费账单
        checkCenterTelephone: {
          key: 'check-center-telephone',
          url: '/main/financial-management/check-center/check-center-telephone/:type',
          components: CheckCenterBillComp,
          parent: 'financial-management'
        }
      },
      parent: 'financial-management',
      pageRole:'VENDORRECONCILIATION',
      fpItem: ["web.finance.vendor.reconciliation.disabled"],
      fpValue: [[false,undefined]]
    },
    // //供应商维护
    // {
    //   key: 'supplier-maintain',
    //   url: '/main/financial-management/supplier-maintain',
    //   components: SupplierManagementComp,
    //   children:{
    //     //供应商管理-银行定义
    //     supplierBankAccount: {
    //       key: 'supplier-bank-account',
    //       url: '/main/financial-management/supplier-maintain/:id/supplier-bank-account/:source',
    //       components: SupplierBankAccountComp,
    //       parent: 'supplier-maintain'
    //     },
    //     //供应商管理-公司分配
    //     supplierCompanyDelivery: {
    //       key: 'supplier-company-delivery',
    //       url: '/main/financial/management/supplier-maintain/:id/supplier-company-delivery',
    //       components: SupplierCompanyDeliveryComp,
    //       parent: 'supplier-maintain'
    //     },
    //     //供应商详情
    //     supplierDetail:{
    //       key:'supplier-maintain-detail',
    //       url:'/main/financial-management/supplier-maintain/supplier-maintain-detail/:id',
    //       components:SupplierDetailComp,
    //       parent:'supplier-maintain'
    //     }
    //   },
    //   parent: 'financial-management',
    //   fpItem: ["web.finance.vendor.master.disabled"],
    //   pageRole:'VENDORMAINTENANCE',
    //   fpValue: [[false,undefined]]
    // },
    //批量打印电子票
    {
      key:'batch-print-invoice',
      url:'/main/financial-management/batch-print-invoice',
      components: BatchPrintInvoiceComp,
      parent: 'financial-management',
      pageRole:'PRINTINVOICEBATCH',
      fpItem: ["finance.print.invoice.batch.disabled"],
      fpValue: [[false,undefined]]
    },
    //待开票
    {
      key: 'wait-for-billing',
      url: '/main/financial-management/wait-for-billing',
      components: WaitForBillingComp,
      parent: 'financial-management',
      children: {
        //滴滴待开票
        waitForBilling: {
          key: 'wait-for-billing-list',
          url: '/main/financial-management/wait-for-billing/wait-for-billing-list/:billingType',
          components: WaitForBillingListComp,
          parent: 'wait-for-billing'
        },
        //发票状态查询
        invoiceStatusQuery: {
          key: 'invoice-status-query',
          url: '/main/financial-management/wait-for-billing/wait-for-billing-list/:billingType/invoice-status-query/:companyOID/:receiptedInvoiceOID',
          components: InvoiceStatusQueryComp,
          parent: 'wait-for-billing-list'
        },
        //京东待开票
        waitForBillingJd: {
          key: 'wait-for-billing-jd',
          url: '/main/financial-management/wait-for-billing/wait-for-billing-jd',
          components: WaitForBillingJdComp,
          parent: 'wait-for-billing'
        },
        //开票详情
        billingDetail:{
          key:'billing-detail',
          url:'/main/financial-management/wait-for-billing/wait-for-billing-list/billing-detail/:receiptedInvoiceOID/:billingType',
          components:BillingDetailComp,
          parent:'wait-for-billing'
        },
        //新建开票常用条件
        newBillingRule:{
          key:'new-billing-rule',
          url:'/main/financial-management/wait-for-billing/wait-for-billing-list/new-billing-rule/:billingType',
          components:NewBillingRuleComp,
          parent:'wait-for-billing'
        },
        //修改开票规则
        editBillingRule:{
          key:'edit-billing-rule',
          url:'/main/financial-management/wait-for-billing/wait-for-billing-list/edit-billing-rule/:id/:billingType',
          components:EditBillingRuleComp,
          parent:'wait-for-billing'
        },
        //查询开票
        searchNewBiiling:{
          key:'search-new-billing',
          url:'/main/financial-management/wait-for-billing/wait-for-billing-list/search-new-billing/:billingType',
          components:SearchNewBillingComp,
          parent:'wait-for-billing',
        },
        //查询详情
        searchBillingDetail:{
          key:'search-billing-detail',
          url: '/main/financial-management/wait-for-billing/wait-for-billing-list/search-new-billing/search-billing-detail/:billingType/:legalEntityOid',
          components:SearchBillingDetailComp,
          parent:'search-new-billing',
        }
      },
      pageRole:'RECEIPTEDINVOICES',
      fpItem: ["web.finance.wait.receipted"],
      fpValue: [[false,undefined]]
    },
    //借还款管理
    {
      key: 'loan-and-refund',
      url: '/main/financial-management/loan-and-refund',
      components: LoanAndRefundComp,
      parent: 'financial-management',
      children: {
        //全局查看
        overallSubList: {
          key: 'overall-sub-list',
          url: '/main/financial-management/loan-and-refund/overall-sub-list',
          components: OverallSubListComp,
          parent: 'loan-and-refund'
        },
        //详情页面
        loanRefundDetail: {
          key: 'loan-refund-detail',
          url: '/main/financial-management/loan-and-refund/overall-sub-list/loan-refund-detail/:formOID/:loanBillOID/:backType',
          components: LoanDetailComp,
          parent: 'loan-and-refund'
        },
        //报销单详情
        expenseReportDetailView: {
          key:'loan-refund-detail-expense',
          url:'/main/financial-management/loan-and-refund/loan-refund-detail-expense/:expenseReportOID',
          components: ExpenseReportDetailComp,
          parent: 'loan-and-refund'
        },
        loanDetail: {
          key: 'loan-detail-refund',
          url: '/main/financial-management/loan-and-refund/loan-refund-detail/:formOID/:loanBillOID/:backType',
          components: LoanDetailComp,
          parent: 'loan-and-refund'
        },
        //餐厅全局查看
        overallRestaurantList: {
          key: 'overall-restaurant-list',
          url: '/main/financial-management/loan-and-refund/overall-restaurant-list',
          components: OverallRestaurantListComp,
          parent: 'loan-and-refund'
        },
      },
      pageRole:'LOANMANAGEMENT',
      fpItem: ["finance.loan.repayment.disabled"],
      fpValue: [[false,undefined]]
    },

    //过账日期
    {
      key: 'posting-date',
      components: ThirdPartyComp,
      url: '/main/third-party/third-party',
      thirdTypeUrl:{pathname:'/main/third-party/third-party', state:{type:'posting-date'}},
      parent: 'financial-management',
      fpItem: ['finance.jinko.passedfee.enabled'],
      fpValue: [true]
    },
    //凭证导出
    {
      key: 'credential-export',
      components: ThirdPartyComp,
      url: '/main/third-party/third-party',
      thirdTypeUrl:{pathname:'/main/third-party/third-party', state:{type:'credential-export'}},
      param: 'token',
      parent: 'financial-management',
      fpItem: ['finance.junchuang.certificate.export.enabled'],
      fpValue: [true]
    },
    {
      key: 'entry-information',
      components: EntryInformationComp,
      url: '/main/financial-management/entry-information',
      parent: 'financial-management',
    },
    //发票袋审核
    // @deprecated 移入bsc审核
    // {
    //   key: 'invoice-bag-approve',
    //   components: InvoiceBagApprove,
    //   url: '/main/financial-management/invoice-bag-approve',
    //   parent: 'financial-management',
    //   children: {
    //     invoiceBagApproveDetail: {
    //       key: 'invoice-bag-approve-detail',
    //       url: '/main/financial-management/invoice-bag-approve/invoice-bag-approve-detail/:id',
    //       components: InvoiceBagApproveDetail,
    //       parent: 'invoice-bag-approve'
    //     }
    //   }
    // },
    //结算费用
    {
      key: 'settlement-cost',
      components: SettlementCost,
      url: '/main/financial-management/settlement-cost',
      parent: 'financial-management',
    },
    //信用管理
    {
      newPermission: true,
      key:'credit-management',
      url:'/main/financial-management/credit-management',
      components: CreditManagementComp,
      parent: 'financial-management'
    },
    //发票管理平台
    {
      key: 'invoice-management-platform',
      components: InvoiceManagementPlatformComp,
      url: '/main/financial-management/invoice-management-platform',
      parent: 'financial-management',
    },
    {
      key: 'meiya-account-period',
      components: MeiyaAccountPeriodComp,
      // components: DdAccountPeriodComp,
      url: '/main/financial-management/meiya-account-period',
      parent: 'financial-management',
    },
    {
      key: 'dd-account-period',
      components: DdAccountPeriodComp,
      url: '/main/financial-management/dd-account-period',
      parent: 'financial-management',
    },
  ],
  pageRole:'FINANCEMANAGEMENT',
  fpItem: ["finance.disabled"],
  fpValue: [[false,undefined]],
};

export default financialManagement;
